package com.example.wordserver.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.wordserver.entity.Country;
import com.example.wordserver.entity.Countrylanguage;
import com.example.wordserver.service.impl.CountrylanguageServiceImpl;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lhx
 * @since 2024-01-27
 */
@RestController
@RequestMapping("/countrylanguage")
public class CountrylanguageController {
@Resource
    private CountrylanguageServiceImpl countryLangauageService=new CountrylanguageServiceImpl();
@GetMapping("/getByCode/{CountryCode}")
    public List<Countrylanguage> getBycode(@PathVariable String CountryCode)
{
    QueryWrapper<Countrylanguage> countryQueryWrapper=new QueryWrapper<>();
    countryQueryWrapper.eq("CountryCode",CountryCode);
    List<Countrylanguage> list = countryLangauageService.list(countryQueryWrapper);
    return list;
}
}

